﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace SharpDiary.Core.Controls
{
    public class Panel3D: PanelEx
    {
        #region Fields & Properties

        private Border3DStyle _borderStyleEx = Border3DStyle.Raised;

        private Border3DSide _borderSide = Border3DSide.All;

        public Border3DSide BorderSide
        {
            get { return _borderSide; }
            set
            {
                _borderSide = value;
                Invalidate();
            }
        }

        public Border3DStyle BorderStyleEx
        {
            get { return _borderStyleEx; }
            set
            {
                _borderStyleEx = value;
                Invalidate();
            }
        }

        #endregion

        #region Constructors

        public Panel3D() { DoubleBuffered = true; }

        #endregion

        #region Methods

        protected override void OnPaintBackground(PaintEventArgs e)
        {
            base.OnPaintBackground(e);

            ControlPaint.DrawBorder3D(e.Graphics, this.ClientRectangle, _borderStyleEx, _borderSide);
        }

        protected override void OnSizeChanged(EventArgs e)
        {
            base.OnSizeChanged(e);

            Invalidate();
        }

        #endregion


    }
}
